<script type="text/javascript" src="{$apm.baseurl}app/js/jquery.js"></script>

{literal}
<script type="text/javascript">

//	$('#freeword').val(decodeURI($("input[name='search']").attr('value')));
    $(function() {
        $('.pager').click(function() {
			//ADD	2011/08/30	仕様変更（freeword入力時はPOST送信）
			if($('.freeword').attr('value')){
	            $('#post_form').attr('action','/membersite/{/literal}{$shopcd}{literal}/');
	            $("input[name='page']").val($(this).attr('name'));
	            $('#post_form').submit();
			}
        });
        $('.button').click(function() {
            $('#post_form').attr('action','/membersite/{/literal}{$shopcd}{literal}/');
            $("input[name='page']").val(1);
            $('#post_form').submit();
        });
    });
</script>
{/literal}

<div id="blogSearch">
	<div id="searchForm">
		<form id="post_form" method="post" action="{$action}">
			<input type="hidden" name="page" value="" />
			<!-- <p class="txt">　検索結果：<span>{$total_count}</span>件中{$start_cnt}～{$end_cnt}件を表示しています</p> -->
			<p id="inputKeyword"><input type=text class='freeword' name='search' value='{$search}'></p>
			<p id="searchBtn"><input type="image" src="{$apm.baseurl}images/membersite/index/btn_search.gif" alt="検索" class="rollImg button" /></p>
		</form>
	</div>

	<div id="pagingBlock">
		{if $prev != ''}
		<p class="prev">
			{if $search == ''}
				{assign var=prevpage value=$curpage-1}
				<a class="pager" name="{$prev}" href="/membersite/{$shopcd}/{$prevpage}/">
			{else}
				<a class="pager" name="{$prev}" href="#">
			{/if}
			<img src="{$apm.baseurl}images/membersite/index/btn_prev.gif" alt="前へ" width="12" height="12" class="rollImg" /></a>
		</p>
		{/if}
		{if $next != ''}
		<p class="next">
			{if $search == ''}
				{assign var=nextpage value=$curpage+1}
				<a class="pager" name="{$next}" href="/membersite/{$shopcd}/{$nextpage}/">
			{else}
				<a class="pager" name="{$next}" href="#">
			{/if}
			<img src="{$apm.baseurl}images/membersite/index/btn_next.gif" alt="次へ" width="12" height="12" class="rollImg" /></a>
		</p>
		{/if}
		<p class="paging">
		{section name=cnt start=$start_page loop=$end_page+1}
			{if $smarty.section.cnt.index == $curpage}
				<a class="pager" style="color:gray;">{$smarty.section.cnt.index}</a>
			{else}
				{* 検索文字がない場合　静的URLでGETリクエスト *}
				{if $search == ''}
					<a class="pager" name="{$smarty.section.cnt.index}" href="/membersite/{$shopcd}/{$smarty.section.cnt.index}/">
						{$smarty.section.cnt.index}</a>
				{* 検索文字がある場合　JSでPOSTリクエスト *}
				{else}
					<a class="pager" name="{$smarty.section.cnt.index}" href="#">{$smarty.section.cnt.index}</a>
				{/if}
			{/if}
		{/section}
		</p>
		<p>
	</div>
</div>
